package Week1.J0415;

//移除连续重复的字符

import java.util.Scanner;

public class ClickToErase {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        StringBuilder sbr = new StringBuilder();
        sbr.append(scanner.nextLine());

        int i = 0;

        while (i < sbr.length()-1) {
            if (sbr.charAt(i) == sbr.charAt(i+1)) {
                sbr.delete(i,i+2);
                i = 0;
                continue;
            }
            i++;
        }

        if (sbr.length() == 0) {
            System.out.println("0");
        }else {
            System.out.println(sbr.toString());
        }
    }
}
